package com.wfit.bankproject.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wfit.bankproject.entity.Details;
import com.wfit.bankproject.entity.JsonResult;
import com.wfit.bankproject.mapper.DetailsMapper;
import com.wfit.bankproject.service.DetailsService;
import com.wfit.bankproject.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Currency;

@Service
public class DetailsServiceImpl extends ServiceImpl<DetailsMapper, Details> implements DetailsService {
    @Autowired
    private DetailsMapper mapper;

    @Override
    public IPage<Details>  selectPage(Long userId,Integer current, Integer size) {
        IPage<Details> page=new Page<>(current,size);
        LambdaQueryWrapper<Details> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Details::getUserId,userId);

        IPage<Details>  detailsIPage = mapper.selectPage(page, queryWrapper);
        return detailsIPage;
    }

}
